/**
 * 
 */
package com.thor.palmmall.rest.inspect.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.inspect.ACategory;
import com.thor.palmmall.rest.sales.input.APayments;
import com.thor.palmmall.spi.inspect.SCategory;

/**
 * @author NuoSa
 *
 * @since 1.0
 */
public class ACategoryConverter implements Converter<SCategory, ACategory> {

  public static ACategoryConverter getInstance() {
    if (instance == null)
      instance = new ACategoryConverter();
    return instance;
  }

  private static ACategoryConverter instance;

  private ACategoryConverter() {
  }

  @Override
  public ACategory convert(SCategory source) {
    if (source == null) {
      return null;
    }
    ACategory target = new ACategory();
    target.setKey(source.getKey());
    target.setValue(source.getValue());
    return target;
  }

}
